import {createRouter, createWebHashHistory} from "vue-router";

const routes = [
    {
        path: '',
        name: 'login',
        component: () => import('../components/login/allLogin.vue'),
    },
    {
        path: '/login',
        name: 'login',
        component: () => import('../components/login/allLogin.vue'),
        children: [
            {
                path: '/login',
                name: 'login',
                component: () => import('../components/login/toLogin.vue'),
            },
        ]
    },
    {
        path: '/admin',
        name: 'admin',
        component: () => import('../components/admin/adminNavigation.vue'),
        children: [
            {
              path: '/admin',
              name: 'admin',
              component: () => import('../components/admin/adminDefault.vue'),
            },
            {
                path: '/admin/user',
                name: 'adminUser',
                component: () => import('../components/admin/adminUser.vue'),
            },
            {
                path: '/admin/result',
                name: 'adminResult',
                component: () => import('../components/admin/adminResult.vue'),
            }
        ]
    },
    {
        path: '/teacher',
        name: 'teacher',
        component: () => import('../components/teacher/NavigationBar.vue'),
        children: [
            {
                path: '/teacher',
                name: 'teacher',
                component: () => import('../components/teacher/allHome.vue'),
            },
            {
                path: '/teacher/stu',
                component: () => import('../components/teacher/studentHome.vue'),
            }
        ]
    },
    {
        path: '/student',
        name: 'stu',
        component: () => import('../components/stu/NavigationBar.vue'),
        children: [
            {
                path: '/student',
                name: 'stu',
                component: () => import('../components/stu/allHome.vue'),
            },
        ]
    },
]

const router = createRouter({
    history : createWebHashHistory(),
    routes //简写 原为 routes  : routes
})

export default router